#define _CRT_SECURE_NO_WARNINGS

#include "SList.h"

Test1()
{
	SLNode* plist = NULL;

	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SListPopBack(&plist);
	SListPopBack(&plist);

	SListPushBack(&plist, 10);



	SListPrint(plist);

	SListDestory(&plist);
}

void Test2()
{
	SLNode* plist = NULL;

	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SLNode* pos1 = SListFind(plist, 2);
	SListInsertAfter(pos1, 200);

	SLNode* pos2 = SListFind(plist, 200);
	SListEraseAfter(pos2);

	SListPrint(plist);

	SListDestory(&plist);
}

void Test3()
{
	SLNode* plist = NULL;

	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SLNode* phead = Reverse(plist);

	SListPrint(plist);
	SListPrint(phead);

	SListDestory(&plist);
	SListDestory(&phead);
}

void Test4()
{
	SLNode* plist = NULL;

	SListPushBack(&plist, 6);
	SListPushBack(&plist, 7);
	SListPushBack(&plist, 5);
	SListPushBack(&plist, 4);
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 8);
	SListPushBack(&plist, 9);
	SListPushBack(&plist, 4);
	SListPushBack(&plist, 5);

	SLNode* ret = partition(plist, 5);

	SListPrint(ret);

	SListDestory(&plist);
}

void Test5()
{
	SLNode* plist = NULL;

	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 1);

	bool ret = isPalindrome(plist);


	SListPrint(plist);

	SListDestory(&plist);
}


int main()
{
	Test5();

	return 0;
}